﻿Public Class LimitValidate
    Inherits ValidationRule


    Public Overloads Overrides Function Validate(value As Object, cultureInfo As Globalization.CultureInfo) As ValidationResult
        Dim testStr As String = TryCast(value, String)
        Dim result As Integer
            If Integer.TryParse(testStr, result) Then
            If result >= 3 AndAlso result <= 20 Then
                Return New ValidationResult(True, Nothing)
            End If
            End If
        Return New ValidationResult(False, "!")
    End Function
End Class
